package com.misssad.exception;

import com.misssad.enums.ResultEnum;

/**
 * 
 * @author yutao
 * 之所要继承RuntimeException,因为spring框架会对该异常进行事务的回滚，而对Exception是不会的
 */
public class GirlException extends RuntimeException{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public GirlException(Integer code, String message){
		super(message);
		this.code=code;
	}
	
	public GirlException(ResultEnum resultEnum){
		super(resultEnum.getMsg());
		this.code= resultEnum.getCode();
	}
	
	public GirlException(Integer code) {
		super();
		this.code = code;
	}

	private Integer code;
	
	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
}
